<%@ page contentType="text/html;charset=utf-8"%>
<%@page import="com.cs.beneficios.common.ConnectionFactory,com.cs.beneficios.common.entity.Consultas,java.sql.Connection,java.sql.ResultSet,java.sql.SQLException"%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Detalle Programa</title>
    
    
  </head>
  <body>  
  <link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css">
    <P></P>
    <P></P>
    <P></P>
    <P align="center"></P>
    <P align="center" class="titulosenblanco">ADMINISTRACION DE PROGRAMAS</P>
    <P align="center"></P>
      <form name="form" method="get" action="../../servlets/programas/ingresarprograma">
      <table cellspacing="2" cellpadding="3" border="0" width="30%" align="center">
      <%  
  String strcodigo= request.getParameter("Codigo");
  String strnombre = "";
  String strobjetivo = "";
  String strdescripcion = "";
  String strarea = "";
  String strusuario = "";
  String strpoblacion = "";
  String strvigencia = "";
  String strdesde = "";
  String strhasta = "";
 
 //ConnectionFactory cf = new ConnectionFactory("beneficios","beneficios");
 ConnectionFactory cf = new ConnectionFactory();
 Consultas consulta = new Consultas(cf);
 ResultSet rs = null;
 
 try{
    rs = consulta.getDetPrograma(strcodigo);
    }
  catch(Exception e){}
    
    if(rs != null){
       try{
         while(rs.next()){
                strnombre = rs.getString("Nombre");
                strobjetivo = rs.getString("Objetivo");
                strdescripcion = rs.getString("Descripcion");
                strarea = rs.getString("Area");
                strusuario = rs.getString("usuario");
                strpoblacion = rs.getString("Poblacion");
                strdesde = rs.getString("Desde");
                strhasta = rs.getString("Hasta");
                strvigencia = rs.getString("Vigencia");
                }
           }catch(SQLException e){
              e.printStackTrace();
            }
        }else{%>
        <tr>
          <td colspan="2">
            <font>Ocurrio un error, al realizar la consulta</font> 
          </td>
        </tr>
        <%    }%>
        <tr>
          <td class="celdatabla" width="19%">Nombre</td>
          <td width="81%">
            <input type="text" Class="form" value="<%=strnombre%>" maxlength="40" size="40" name="programa" readonly/>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="19%">Objetivo</td>
          <td width="81%">
            <textarea name="objetivo" Class="form" cols="30" rows="5" disabled="disabled"><%=strobjetivo%></textarea>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="19%">Descripcion</td>
          <td width="81%">
            <textarea name="descripcion" Class="form" cols="30" rows="5" disabled="disabled"><%=strdescripcion%></textarea>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="19%">Secretaria</td>
          <td width="81%">
            <input type="text" Class="form" value="<%=strarea%>" name="area" maxlength="40" size="40" readonly/>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="19%">Administrador</td>
          <td width="81%">
            <input type="text" Class="form" value="<%=strusuario%>" name="usuario" maxlength="40" size="40" readonly/>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="19%">Poblacion</td>
          <td width="81%">
            <input type="text" Class="form" value="<%=strpoblacion%>" name="poblacion" maxlength="40" size="40" readonly/>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="19%">Desde(*)</td>
          <td width="81%">
            <input type="text" Class="form" value="<%=strdesde%>"  name="desde" maxlength="15" size="15" readonly/>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="19%">Hasta(*)</td>
          <td width="81%">
            <input type="text" Class="form" value="<%=strhasta%>" name="hasta" maxlength="15" size="15" readonly/>
          </td>
        </tr>
        <tr>
          <td class="celdatabla" width="19%">Vigencia</td>
          <td width="81%">
            <input type="text" Class="form" value="<%=strvigencia%>" name="vigencia" maxlength="10" size="10" readonly/>
          </td>
        </tr>
        <tr>
          <td  width="19%">&nbsp;</td>
          <td width="81%"></td>
        </tr>
         <tr>
          <td width="19%">&nbsp;
          </td>
          </td>
          <td width="81%">
            <DIV align="center">
              <input type="hidden" name="ori" value="mod"/>
              <input type="hidden" name="Programa" value="<%=strnombre%>"/>
              <a href="javascript:window.history.back()">
                <img src="<%=request.getContextPath() + "/images/BACK1-1.gif"%>" border="0"/>
              </a>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </DIV>
</td>
        </tr>
      </table>
      <P>&nbsp;</P>
      <P>&nbsp;</P>
  </form>
  </body>
</html>
